package com.wutong.erb.exception.base;

import java.util.HashMap;
import java.util.Map;

/**
 * 用户操作异常
 * @author wutong
 */
public class UserOperateException extends BaseException {

    private static final Map<Integer, UserOperateException> USER_OPERATE_EXCEPTION_MAP = new HashMap<>();

    public UserOperateException(int code,String message) {
        super(8L, USER_OPERATE_EXCEPTION_MAP, message);
        if (!USER_OPERATE_EXCEPTION_MAP.containsKey(code)) {
            USER_OPERATE_EXCEPTION_MAP.put(code, this);
        } else {
            throw new IllegalArgumentException("ExceptionId 早已存在于异常映射表中，请检查！");
        }
    }
}
